package gazzera.node.core.messages;

import gazzera.utils.*;

import java.io.*;

public class FileHash extends Message {

	public UserFileID userFileId = null;
	public Hash hash = null;
	
	public FileHash()
	{
		super();
	}

	public FileHash(UserFileID userFileId, Hash hash)
	{
		super();
		this.userFileId = userFileId;
		this.hash = hash;
	}

	@Override
	protected void recv(DataInputStream s) throws IOException
	{
		userFileId = (UserFileID)readFileID(s);
		hash = (Hash)readFileID(s);
	}

	@Override
	protected void send(DataOutputStream s) throws IOException
	{
		sendFileID(s, userFileId);
		sendFileID(s, hash);
	}

}
